package com.corpdata.controller;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.corpdata.entity.OrgUser;

@Controller
public class IndexController {
	
	@ResponseBody
	@RequestMapping("/index")
	public Map<String,Object> test(HttpServletRequest request){
		
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("str", "hello!");
		map.put("now", new Date().toString());
		map.put("user", ((OrgUser)request.getSession().getAttribute("userinfo")).toString());
		return map;
	}
}
